// entry/src/main/ets/mqtt/MqttTypes.ts

// --- Incoming Message Types ---

// 海思环境板传感器信息上报
interface EnvironmentServiceProperties {
  Temperature: number;
  Humidity: number;
  Air_Quality: number;
  Fire: number;
  FanStatus: string;
}

export interface EnvironmentService {
  service_id: "Fan";
  properties: EnvironmentServiceProperties;
}

export interface EnvironmentMessage {
  services: EnvironmentService[];
}

// 用于车辆报告消息
export interface VehicleData {
  accelerator: number;
  brake: number;
  steering_wheel: number;
}

export interface VehicleReportMessage {
  topic: 'vehicle_report';
  device: 'driver_controls';
  data: VehicleData;
}

// 所有可能的传入消息的联合类型
export type IncomingMqttMessage = VehicleReportMessage | EnvironmentMessage;


// --- Outgoing Message Types ---

// 用于设备控制消息
export interface DeviceControlPayload {
  topic: "powerseat_detect";
  device: string;
  status: number;
} 